<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>08_v-for的使用</title>
</head>

<body>
  <div id="app">
    <!-- 数组才是重要的 -->
    <!-- v-for="(item,index) in list" -->
    <!-- 想生成多个谁就把v-for放谁身上 -->
   <p v-for="(item, index) in list">{{item}} -- {{index}}</p>
   <br />
   <p v-for="a in list">{{a}}</p>
   <!-- 了解即可 忘了也行 只要不记混 -->

   <!-- 对象的 -->
    <ul>
      <li v-for="(val, key) in person">{{val}}   --- {{key}}</li>
    </ul>
    <!-- 数字的 -->
    <div v-for="item in 9">
      {{item}}
    </div>
  </div>
  <script src="./vue.js"></script>
  <script>
   
    const app = new Vue({
      el: '#app',
      data: {
        list: ['苹果', '香蕉', '橙子', '榴莲'],
        person: {
          name: '张琪',
          age: 18,
          hobby: '看男模'
        }
      },
    })

  </script>
</body>

</html>